#include <stdio.h>
#include <ctype.h>

#define MAX_SIZE 50

void reverse_message(char message[], char*);

int main()
{
    char c, meg[MAX_SIZE], *p = meg;
    printf("Enter a message: ");
    while((c = getchar()) != '\n' && p < meg + MAX_SIZE)
        *p++ = c;
    reverse_message(meg, p);

    return 0;
}

void reverse_message(char message[], char *pointer)
{
    while (pointer > message)
        printf("%c", *--pointer);    
}